Hit testing refers to a process that determines content that is located at a given set of coordinates in web content, such as a webpage. A common scenario for hit testing pertains to that which involves user input, e.g., receiving touch input or mouse click input. Specifically, in order to determine a correct response to user input, hit testing is performed to discover which content is the subject of the user's interaction. Anything that delays a hit test can, in turn, delay the system's response and degrade the user's experience.
In many systems, hit testing is performed on a main thread, for example, the user interface thread. The user interface thread can, however, frequently be busy performing other work. This other work can include JavaScript execution, layout tasks, rendering operations, and the like. As a result, hit tests that occur on the main thread may be blocked for prolonged and variable periods of time.